package com.example.xianji.activity;

import android.os.Bundle;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.xianji.Contant;
import com.example.xianji.R;

public class Main_ZhanHao_GuanliActivity extends Activity {
    private RelativeLayout zhanghao_guanli_back;
    private RelativeLayout relative_layout_xiugai_password;
    private TextView textView_denglu_mima;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        }
        setContentView(R.layout.activity_main__zhan_hao__guanli);
        //XJApplication.getInstance().addActivity(this);
        zhanghao_guanli_back = (RelativeLayout) findViewById(R.id.zhanghao_guanli_relative_back);
        relative_layout_xiugai_password = (RelativeLayout) findViewById(R.id.relative_layout_xiugai_password);
        textView_denglu_mima = (TextView) findViewById(R.id.textView_denglu_mima);

        zhanghao_guanli_back.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                Main_ZhanHao_GuanliActivity.this.finish();
            }
        });

        relative_layout_xiugai_password.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Main_ZhanHao_GuanliActivity.this, XiuGaiPassWordActivity.class);
                startActivityForResult(intent, Contant.change_password_requestCode);
                relative_layout_xiugai_password.setBackgroundColor(getResources().getColor(R.color.grayF2));
                textView_denglu_mima.setTextColor(getResources().getColor(R.color.blue22));
            }
        });
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if (requestCode == Contant.change_password_requestCode && resultCode == Contant.change_password_success_resultCode) {
            Main_ZhanHao_GuanliActivity.this.finish();
        }
    }
}
